package top.xphu;

import net.minidev.json.JSONUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import top.xphu.component.KafkaTemple;

import java.util.HashMap;

/**
 * @author xphu
 * @version 1.0
 * @date 2021/9/3 16:19
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = KafkaDemoApplication.class)
public class KafkaDemo {

    @Autowired
    KafkaTemple kafkaTemple;

    @Test
    public void demo1(){
        HashMap<String, Object> map = new HashMap<>();
        kafkaTemple.asyncProduce("kafka-topic-demo1", JSONUtils);
    }

}
